package nbcb;

import java.util.Scanner;

public class H {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int x, y;
        boolean flag;
        while (sc.hasNext()) {
            x = sc.nextInt();
            y = sc.nextInt();
            if (x == 0 && y == 0) break;
            flag = true;
            for (int i = Math.min(x, y); i <= Math.max(x, y); i++) {
                if (!valid(i * i + i + 41)) {
                    flag = false;
                    break;
                }
            }
            if (flag) System.out.println("OK");
            else System.out.println("Sorry");
        }
    }
    public static boolean valid(int n) {
        if (n <= 0) return false;
        if (n == 1 || n == 2) return true;
        for (int i = 2; i <= (int) Math.sqrt(n); i++) {
            if (n % i == 0) return false;
        }
        return true;
    }
}
